<?php


namespace app\common\model;


use catcher\Utils;

class ClinicalFollowUp extends BaseModel
{
    protected $name = "clinical_follow_up";

    public function getLists(int $type, string $patientId): \think\Paginator
    {
        $users = $this->getUserIds();
        if (!empty($users)) {
            $where[] = ['creator_id', 'in', $users];
        }
        $where[] = ['patientId', '=', $patientId];
        return $this->where("type", "=", $type)
            ->where($where)
            ->order('created_at', 'desc')
            ->paginate($this->pageLimit);
    }
}
